using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

namespace GameFramework.Managers
{
    /// <summary>
    /// The texture manager.
    /// </summary>
    public static class TextureManager
    {
        /// <summary>
        /// Initializes static members of the <see cref="TextureManager"/> class.
        /// </summary>
        static TextureManager()
        {
            Textures = new Dictionary<string, Texture2D>();
        }

        /// <summary>
        /// Gets or sets the textures.
        /// </summary>
        public static Dictionary<string, Texture2D> Textures { get; set; }

        /// <summary>
        /// Load a texture.
        /// </summary>
        /// <param name="assetName">The asset name.</param>
        /// <param name="textureName">The texture name.</param>
        public static void LoadTexture(string assetName, string textureName)
        {
            Textures[textureName] = Global.Game.Content.Load<Texture2D>(assetName);
        }

        /// <summary>
        /// Load a texture. The asset name will be "textures/" followed by the texture name.
        /// </summary>
        /// <param name="textureName">The texture name.</param>
        public static void LoadTexture(string textureName)
        {
            Textures[textureName] = Global.Game.Content.Load<Texture2D>("textures/" + textureName);
        }
    }
}
